<?php 
require_once './core/util.php';


$email = CROUtil::nullToNone(param('email'));
$message = CROUtil::nullToNone(param('message'));

if ( strlen($email) < 1 && strlen($message) < 1 ) {
	echo '<br/><h3>Please enter your message</h3>';
	return;
}
	sendEmail($email, $message);

	echo '<br/><h3>Thank you for your feedback</h3><br/>';

	
function sendEmail($email, $message) {
	$from = 'support@pathkey.org';
	$to   = 'support@pathkey.org';
//$to = "hongpingliang@gmail.com";
	$subject = 'PathKey Feedback';
	$headers = 'From: '.$from. "\r\n" .
	    'Reply-To: '.$from. "\r\n" .
	    'X-Mailer: PHP/' . phpversion();

	
	$t = "\n";
	$t .= $email;
	$t .= "\n";
	$t .= $message;
	$t .= "\n\n";
	
	$t .= "\n\n";
	$t .= "This email was sent by software of PathKey (www.pathkey.org)";
	
//	echo $to.'<br/>'.$subject.'<br/>'.$t;
	
	mail($from, $subject, $t, $headers);
}	

?>


